<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Uma simples página JSF</title>
    </h:head>
    <h:body> 

        <ui:composition template="layout.xhtml">

            <ui:define name="tituloJanela">
                AE-Store :: Login
            </ui:define>

            <ui:define name="conteudo">

                <div id="produtos"> 

                    <h:form>
                        <h:panelGrid columns="3">
                            <h:outputLabel value="Nome:"/>
                            <h:inputText id="nome" value="#{usuarioBean.usuario.nome}" size="20"  required="true" requiredMessage="Campo Obrigatório"/>                                                
                            <h:message for="nome" />

                            <h:outputLabel value="Email:"/>
                            <h:inputText id="email" value="#{usuarioBean.usuario.email}" size="20" required="true" requiredMessage="Campo Obrigatório"/>
                            <h:message for="email" />

                            <h:outputLabel value="Login:"/>
                            <h:inputText id="login" value="#{usuarioBean.usuario.login}" size="20" required="true" requiredMessage="Campo Obrigatório" />
                            <h:message for="login" />

                            <h:outputLabel value="Senha:"/>
                            <h:inputSecret id="senha" value="#{usuarioBean.usuario.senha}" size="20" required="true" requiredMessage="Campo Obrigatório" />
                            <h:message for="senha" />

                            <h:commandButton id="btnE" value="Enviar" type="submit" action="#{usuarioBean.salvarUsuario}"/>
                            <h:commandButton id="btnL" value="Limpar" type="reset" />                

                        </h:panelGrid>
                    </h:form>
                    <h:panelGrid>
                        <h:dataTable id="tablePessoa" value="#{usuarioBean.usuarioLista}" var="p" title="Pessoas Cadastradas" border="1" rows="10" >
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="NOME" />
                                </f:facet>
                                <h:outputText value="#{p.nome}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="EMAIL" />
                                </f:facet>
                                <h:outputText value="#{p.email}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="LOGIN" />
                                </f:facet>
                                <h:outputText value="#{p.login}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="SENHA" />
                                </f:facet>
                                <h:outputText value="#{p.senha}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="TIPO" />
                                </f:facet>
                                <h:outputText value="#{p.tipo}"/>
                            </h:column>                                         

                        </h:dataTable>
                    </h:panelGrid>
                </div>
            </ui:define>

        </ui:composition>

    </h:body>
</html>